﻿/*
**  BoxDef
*/
if (!$.Engine.Collision.Shape || typeof $.Engine.Collision.Shape === "undefined") $.Engine.Collision.Shape = {};
$.Engine.Collision.Shape.PolyDef = function () {
  this.type = $.Engine.Collision.Shape.Shape.e_unknownShape;
  this.userData = null;
  this.localPosition = new $.Engine.Math.Vector2D(0.0, 0.0);
  this.localRotation = 0.0;
  this.friction = 0.2;
  this.restitution = 0.0;
  this.density = 0.0;
  this.categoryBits = 0x0001;
  this.maskBits = 0xFFFF;
  this.groupIndex = 0;
  //

  // initialize instance variables for references
  this.vertices = new Array($.Engine.Settings.maxPolyVertices);
  //

  this.type = $.Engine.Collision.Shape.Shape.e_polyShape;
  this.vertexCount = 0;

  for (var i = 0; i < $.Engine.Settings.maxPolyVertices; i++) {
    this.vertices[i] = new $.Engine.Math.Vector2D();
  }
};

Object.extend($.Engine.Collision.Shape.PolyDef.prototype, $.Engine.Collision.Shape.ShapeDef.prototype);
Object.extend($.Engine.Collision.Shape.PolyDef.prototype, {
  vertices: new Array($.Engine.Settings.maxPolyVertices),
  vertexCount: 0
});

